\section{int --- Integer Filter}
\label{fn:int}
\index{int()}
\index{integer filter}
\index{truncation}
\begin{rail}
Int : 'int' '(' ( Scalar | Matrix ) ')' ;
\end{rail}

\verb+int+ truncates its argument by conversion to an integer. If the
argument is a matrix then the \verb+int+ operation is performed on an 
element-by-element basis.

Because \RLaB\ is not an arbitrary precision system, you may
occasionally be surprised by the results of this function, as shown in
the example below, where we can `truncate' out input of
$1.9999999999999999$ to $2$, which is how it is stored internally.


\paragraph{Example}
\index{example of int()}
\index{int()!example}
\begin{verbatim}
> int(1.0001)
        1
> int(1.5)
        1
> int(1.999999999999999)
        1
> int(1.9999999999999999)
        2
> 1.999999999999999
        2
> b = 100*(rand(2,3)+rand(2,3)*(0+1j))
 b =
 matrix columns 1 thru 3
              16.1 + 29i            1.06 + 56.1i            23.3 + 26.9i
            97.5 + 20.5i            41.4 + 79.1i            55.5 + 33.4i

> int(b)
 matrix columns 1 thru 3
                16 + 29i                 1 + 56i                23 + 26i
                97 + 20i                41 + 79i                55 + 33i
\end{verbatim}

See also: Page~\pageref{fn:ceil} \verb+ceil()+,
Page~\pageref{fn:floor} \verb+floor()+,
Page~\pageref{fn:round} \verb+round()+.

\newpage




